<form id="pagerForm" method="post" action="">
	<input type="hidden" name="pageNum" value="{$pageNum}" />
	<input type="hidden" name="numPerPage" value="{$numPerPage}" />
	<input type="hidden" name="orderField" value="{$orderField}" />
	<input type="hidden" name="orderDirection" value="{$orderDirection}" />
</form>
<div class="pageHeader">
	<form rel="pagerForm"  onsubmit="return navTabSearch(this);" action="{:U($module_name.'/'.$action_name)}" method="post">
		    <div class="searchBar">
            <ul class="searchContent">
                <li style="width:200px;">
                <label style="width: 50px;">关键字：</label>
                <input type="text" name="keywords" value="{$keywords}"/>
                </li>
                <li style="width: 100px;">
               <select name="sfield" class="combox">
				<option value="all" {if $wherefields=='all'}selected="selected"{/if}>全部</option>
				<option value="name" {if $wherefields=='name'}selected="selected"{/if}>分组名</option>
			</select>
			<input type="hidden" name="sfield_name" value="name" />					
                </li>					
				
				
                <li style="padding-top:0;"><div clas0s="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
            </ul>
        </div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="{:U('Attribute/attgr')}" target="dialog" width="800" height="650"><span>添加</span></a></li>
		</ul>
	</div>
	<table class="table" width="1200" layoutH="113">
		<thead>
			<tr>
				<th width="25"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
				<th width="20" >ID</th>
				<th width="80" >分组名称</th>
				<th width="50" >排序</th>
				<th width="60" >模型名称</th>
				<th width="60" align="center">操作</th>
			</tr>
		</thead>
		<tbody>
		<volist name='glist' id='b'>
			<tr target="sid_user">
				<td><input name="ids" value="{$b['id']}" type="checkbox" class="type"></td>
				<td>{$b['id']}</td>
				<td><a href="{:U('Attribute/groupinfo',array('id'=>$b['id']))}" target="dialog" width="600" height="450">{$b['name']}</a></td>
				<td><input id="sequence{$b.id}" type='text' onblur="ajax_update({$b.id} , 'sequence')" value='{$b.sequence}' style='width:50px;' /></td>
				<td>{$modelname[$b['modelname']]['title']}</td>
				<td>
					<a title="编辑" href="{:U('Attribute/attgr',array('id'=>$b['id']))}" target="dialog" width="800" height="580" rel=“Brand_edit" class="btnEdit">编辑</a>
					<a title="确实要删除这条记录吗?" href="{:U('Attribute/delattrg',array('id'=>$b['id']))}" class="btnDel" target="ajaxTodo" title="确定要删除吗?">删除</a>
				</td>
			</tr>
		</volist>
		</tbody>
	</table>
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="20" {if $numPerPage==20}selected="selected"{/if}>20</option>
				<option value="50" {if $numPerPage==50}selected="selected"{/if}>50</option>
				<option value="100" {if $numPerPage==100}selected="selected"{/if}>100</option>
				<option value="200" {if $numPerPage==200}selected="selected"{/if}>200</option>
			</select>
			<span>条，共{$totalCount}条</span>
		</div>
		
		<div class="pagination" targetType="navTab" totalCount="{$totalCount}" numPerPage="{$numPerPage}" pageNumShown="10" currentPage="{$pageNum}"></div>
	</div>
</div>
<script>
	
	//修改排序 和 适用平台
	function ajax_update(id,field){
		var value = $('#'+field+id).val();
		$.ajax({
			type: "POST",
			url: "{:U('Attribute/ajax_update')}",
			data: 'id='+id+'&field='+field+'&value='+value+'&dao=attribute_group',
			dataType:'json',
			success: function(msg){
				if (msg == 1) {
					//alertMsg.info('修改成功！');
				}else{
					//alertMsg.info('修改私！');
				}
			}
		});
	}

</script>
